/**
 *添加登录日志记录
 */
import store from '@/store/'
import * as types from '@/store/mutation-types'
import userService from 'SERVICE/userService'

export default (to, from, next) => {

  let cropId = localStorage.getItem("cropId");//区分本地，本地无cropId，所以不要调用登录日志接口
  
  if(!store.getters.addUserLoginLog && cropId && store.getters.userInfo&&store.getters.userInfo.token){
    userService.addUserLoginLog();
    store.dispatch('getAddUserLoginLog');
  }

}